﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Vit.Database.Schema
{
    [Serializable]
    public abstract class CommandSchema : SchemaObjectBase
    {
        public CommandSchema()
        {
            Parameters = new List<ParameterSchema>();
        }

        public ParameterSchema GetParameter(string name)
        {
            return Parameters.FirstOrDefault(o => string.Equals(o.Name, name, StringComparison.OrdinalIgnoreCase));
        }

        public string CommandText { get; set; }
        public abstract CommandObjectType CommandType { get; }

        public List<ParameterSchema> Parameters { get; set; }
    }
}
